﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebStateManageStudy
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack) { DropDownList1.Items.Add("dd1"); DropDownList1.Items.Add("dd2"); DropDownList1.SelectedIndex = 0; }
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            int i = DropDownList1.SelectedIndex; 
            i = DropDownList1.Items.Count;

            this.TextBox1.Text = i.ToString();
        }
    }
}
